package extends1demo;

public class Student extends People {
    private String hobby;
    private String school;

    public Student() {
    }
    public Student(String name, char sex, String hobby) {
        // this调用兄弟构造器。
        // 注意：super(...) this(...) 必须写在构造器的第一行，而且两者不能同时出现。
//        super(name, sex);
//        this.hobby = hobby;
        this(name, sex, hobby, "黑马程序员");
    }

    public Student(String name, char sex, String hobby, String school) {
        // super(); // 必须在第一行
    super(name, sex);
        this.hobby = hobby;
        this.school = school;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }
}
